<html>
<head>
<title>在线加解密工具</title>
<meta http-equiv="Content-Type" content="text/html"; charset="UTF-8">
<style>
/**输入框美化
input{
        border: 1px solid #ccc;
        padding: 7px 0px;
        border-radius: 3px;
        padding-left:5px;
        -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
        box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
        -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
        -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
        transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s
}
input:focus{
        border-color: #66afe9;
        outline: 0;
        -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);
        box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)
}
**/
BODY {
	SCROLLBAR-FACE-COLOR: #b0bec7; FONT-SIZE: 10pt; SCROLLBAR-HIGHLIGHT-COLOR: #ffffff; SCROLLBAR-SHADOW-COLOR: #ffffff; COLOR: #0c2958; SCROLLBAR-3DLIGHT-COLOR: #b0bec7; SCROLLBAR-ARROW-COLOR: #ffffff; SCROLLBAR-TRACK-COLOR: #b0bec7; SCROLLBAR-DARKSHADOW-COLOR: #b0bec7; BACKGROUND-COLOR: #ffffff
}
TEXTAREA {
	WIDTH: 100%; COLOR: #15217d; BACKGROUND-COLOR: #eaeee7
}
#oInput {
	FONT-FAMILY: "Courier new"
}
INPUT {
	
}
.STYLE1 {color: #FF0000}
.STYLE4 {color: #FF00FF}


/**单选框美化**/
.radio {
  margin: 0.5rem;
}
.radio input[type="radio"] {
  position: absolute;
  opacity: 0;
}
.radio input[type="radio"] + .radio-label:before {
  content: '';
  background: #f4f4f4;
  border-radius: 100%;
  border: 1px solid #b4b4b4;
  display: inline-block;
  width: 1.4em;
  height: 1.4em;
  position: relative;
  top: -0.2em;
  margin-right: 1em;
  vertical-align: top;
  cursor: pointer;
  text-align: center;
  -webkit-transition: all 250ms ease;
  transition: all 250ms ease;
}
.radio input[type="radio"]:checked + .radio-label:before {
  background-color: #3197EE;
  box-shadow: inset 0 0 0 4px #f4f4f4;
}
.radio input[type="radio"]:focus + .radio-label:before {
  outline: none;
  border-color: #3197EE;
}
.radio input[type="radio"]:disabled + .radio-label:before {
  box-shadow: inset 0 0 0 4px #f4f4f4;
  border-color: #b4b4b4;
  background: #b4b4b4;
}
.radio input[type="radio"] + .radio-label:empty:before {
  margin-right: 0;
}
</style>

<script language="JavaScript">
var ALPHABET = "abcdefghijklmnopqrstuvwxyz";
var ABC_KEY = "a b c d e f g h i j k l m n o p q r s t u v w x y z";

function clamp(n, min, max)
{
	n = parseInt(n);
	min = parseInt(min);
	max = parseInt(max);
	if (n < min) return min;
	if (n > max) return max;
	return n;
}

function numChar(n, c)
{
	var s = "";
	for (var i = 0; i < n; i++)
    {
        s += c;
    }
    return s;
}

function charOffset(c, offset)
{
	if (offset < 0)
		offset += 26;
	if (c > 64 && c < 91) // 大写字母
		return String.fromCharCode((c-65+offset)%26+65);
	else if (c > 96 && c < 123) // 小写字母
		return String.fromCharCode((c-97+offset)%26+97);
	else
		return String.fromCharCode(c);
}

// abcdefg... 替换为 zyxwvu...
function Inverse(strIn)
{
	var strOut = "", offset;
	for (var i = 0; i < strIn.length; i++)
	{
		offset = strIn.charCodeAt(i) - 96;
		strOut += charOffset(97, -offset);
	}
	return strOut;
}

function Reverse(strIn)
{
	var strOut = "";
	for (var i = 0; i < strIn.length; i++)
	{
		strOut = strIn.charAt(i) + strOut;
	}
	return strOut;
}

/////////////////////////////////////////////////////////////
// 替代密码
function isMono(aItem)
{
	for (var i = 0; i < aItem.length; i++)
	{
		if (aItem[i].length > 1)
			return false;
	}
	return true;
}

function Substitute(strIn, keys, items)
{
	keys  =  keys.replace(/(^\s+)|(\s+$)/g, "").replace(/\s+/g, " ");
	items = items.replace(/(^\s+)|(\s+$)/g, "").replace(/\s+/g, " ");
	var aKey = keys.split(" ");
	var aItem = items.split(" ");
	var strOut = "";
	if (oSubCaseSen.checked) // 忽略大小写
		strIn = strIn.toLowerCase();
	var JustOneLetter = isMono(aItem);
	for (var i = 0; i < strIn.length; i++)
	{
		for (var j = 0; j < aKey.length; j++)
		{
			if (strIn.charAt(i) == aKey[j])
			{
				strOut += aItem[j];
				if (!JustOneLetter)
					strOut += " ";
				break;
			}
		}
		if (j == aKey.length && i < strIn.length-1)
		{
			strOut += " ";
		}
	}
	return strOut;
}

function SubstituteBack(strIn, keys, items, separate)
{
	keys  =  keys.replace(/(^\s+)|(\s+$)/g, "").replace(/\s+/g, " ");
	items = items.replace(/(^\s+)|(\s+$)/g, "").replace(/\s+/g, " ");
	if (oSubCaseSen.checked){ // 忽略大小写
		keys = keys.toLowerCase();
		items = items.toLowerCase();
		strIn = strIn.toLowerCase();
	}
	var aKey = keys.split(" ");
	var aItem = items.split(" ");
	var strOut = "", code;
	var JustOneLetter = isMono(aItem);
	if (!JustOneLetter)
		strIn = strIn.split(" ");

	for (var i = 0; i < strIn.length; i++)
	{
		for (var j = 0; j < aItem.length; j++)
		{
			code = JustOneLetter ? strIn.charAt(i) : strIn[i];
			if (code == aItem[j])
			{
				strOut += aKey[j];
				if (separate)
					strOut += " ";
				break;
			}
		}
		if (j == aItem.length && i < strIn.length-1)
			strOut += " ";
	}
	return strOut;
}

function enSubstitution()
{
	var aTable = oSubTable.value.split("\n");
	if (isMono(aTable[0].split(" ")))
		oInput.value = Substitute(oInput.value, aTable[0], aTable[1]);
	else
		oInput.value = SubstituteBack(oInput.value, aTable[1], aTable[0], true);
}

function outSubstitution()//解密
{	
    var aTable = oSubTable.value.split("\n");
	if (isMono(aTable[0].split(" ")))
		oInput.value = SubstituteBack(oInput.value, aTable[0], aTable[1]);
	else
		oInput.value = SubstituteBack(oInput.value, aTable[0], aTable[1], true);
		
}

function showSubstitutionItem()
{
	var aTable = oSubTable.value.split("\r\n");
	var keys = aTable[0].replace(/(^\s+)|(\s+$)/g, "").replace(/\s+/g, " ");
	var items = aTable[1].replace(/(^\s+)|(\s+$)/g, "").replace(/\s+/g, " ");
	if (oSubCaseSen.checked) // 忽略大小写
		keys = keys.toLowerCase();
	var aKey = keys.split(" ");
	var aItem = items.split(" ");

	var JustOneLetter = isMono(aItem);
	var strOut = "", code, strIn;
	var strIn = oInput.value;
	if (!JustOneLetter)
		strIn = strIn.split(" ");

	for (var i = 0; i < strIn.length; i++)
	{
		for (var j = 0; j < aItem.length; j++)
		{
			code = JustOneLetter ? strIn.charAt(i) : strIn[i];
			if (code == aItem[j])
			{
				strOut += aKey[j] + "(" + aItem[j] + ") ";
				break;
			}
		}
		if (j == aItem.length && i < strIn.length-1)
			strOut += " ";
	}
	oInput.value = strOut;
}

function changeSubstitutionTable()
{
	var type = oSubOptions.options[oSubOptions.selectedIndex].text;

	switch (type)
	{
		case "字母表代码":
			oSubTable.value = "a b c d e f g h i j k l m n o p q r s t u v w x y z\n01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26"; break;
		case "字母表数字":
			oSubTable.value = "a b c d e f g h i j k l m n o p q r s t u v w x y z\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26"; break;
		case "培根大小写":
			oSubTable.value = "a a a a a a a a a a a a a a a a a a a a a a a a a a b b b b b b b b b b b b b b b b b b b b b b b b b b\nA B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z\na b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"; break;
		case "培根ab":
			oSubTable.value = "a b c d e f g h i j k l m n o p q r s t u v w x y z\naaaaa aaaab aaaba aaabb aabaa aabab aabba aabbb abaaa abaab ababa ababb abbaa abbab abbba abbbb baaaa baaab baaba baabb babaa babab babba babbb bbaaa bbaab"; break;
		case "Atbash":
			oSubTable.value = "a b c d e f g h i j k l m n o p q r s t u v w x y z\nz y x w v u t s r q p o n m l k j i h g f e d c b a"; break;
		case "QWE":
			oSubTable.value = "a b c d e f g h i j k l m n o p q r s t u v w x y z\nq w e r t y u i o p a s d f g h j k l z x c v b n m"; break;
		case "5*5矩阵":
			oSubTable.value = "a b c d e f g h i j k l m n o p q r s t u v w x y z\n11 12 13 14 15 21 22 23 24 24 25 31 32 33 34 35 41 42 43 44 45 51 52 53 54 55"; break;
		case "三进制":
			oSubTable.value = "a b c d e f g h i j k l m n o p q r s t u v w x y z\n001 002 010 011 012 020 021 022 100 101 102 110 111 112 120 121 122 200 201 202 210 211 212 220 221 222"; break;
		case "V字":
			oSubTable.value = "a b c d e f g h i j k l m n o p q r s t u v w x y z\n13 58 36 35 34 46 57 68 89 79 80 9- 70 69 90 0- 12 45 24 56 78 47 23 25 67 14"; break;
		case "三分密码":
			oSubTable.value = "a b c d e f g h i j k l m n o p q r s t u v w x y z\n111 121 131 112 122 132 113 123 133 211 221 231 212 222 232 213 223 233 311 321 331 312 322 332 313 323"; break;
		case "费纳姆密码":
			oSubTable.value = "a b c d e f g h i j k l m n o p q r s t u v w x y z\n1000001 1000010 1000011 1000100 1000101 1000110 1000111 1001000 1001001 1001010 1001011 1001100 1001101 1001110 1001111 1010000 1010001 1010010 1010011 1010100 1010101 1010110 1010111 1011000 1011001 1011010"; break;
		case "随机乱序字母":
			oSubTable.value = "a b c d e f g h i j k l m n o p q r s t u v w x y z\nw x n o r g y z h l e f q a b i j m s t u d p c k v"; break;
		case "棋盘密码":
			oSubTable.value = "b t a l p d h o z k q f v s n g i j c u x m r e w y\naa ad af ag ax da dd df dg dx fa fd ff fg fx ga gd gd gf gg gx xa xd xf xg xx\n11 12 13 14 15 21 22 23 24 25 31 32 33 34 35 41 42 42 43 44 45 51 52 53 54 55"; break;
		case "键盘密码1":
			oSubTable.value = "1 2 3 4 5 6 7 8 9 0 q w e r t y u i o p a s d f g h j k l z x c v b n m , . ?\n10 20 30 40 50 60 70 80 90 00 11 21 31 41 51 61 71 81 91 01 12 22 32 42 52 62 72 82 92 13 23 33 43 53 63 73 83 93 03\n01 02 03 04 05 06 07 08 09 00 11 12 13 14 15 16 17 18 19 10 21 22 23 24 25 26 27 28 29 31 32 33 34 35 36 37 38 39 30"; break;
		case "键盘密码2":
			oSubTable.value = "1 2 3 4 5 6 7 8 9 0 q w e r t y u i o p a s d f g h j k l z x c v b n m , . ?\n!0 @0 #0 $0 %0 ^0 &0 *0 (0 )0 !1 @1 #1 $1 %1 ^1 &1 *1 (1 )1 !2 @2 #2 $2 %2 ^2 &2 *2 (2 !3 @3 #3 $3 %3 ^3 &3 *3 (3 )3\n0! 0@ 0# 0$ 0% 0^ 0& 0* 0( 0) 1! 1@ 1# 1$ 1% 1^ 1& 1* 1( 1) 2! 2@ 2# 2$ 2% 2^ 2& 2* 2( 3! 3@ 3# 3$ 3% 3^ 3& 3* 3( 3)"; break;
		case "键盘移位":
			oSubTable.value = "1 2 3 4 5 6 7 8 9 0 q w e r t y u i o p a s d f g h j k l z x c v b n m ; , .\n2 3 4 5 6 7 8 9 0 - w e r t y u i o p [ s d f g h j k l ; x c v b n m , ' . /"; break;
                case "键盘对称":
			oSubTable.value = "a b c d e f g h i j k l m n o p q r s t u v w x y z\nl c b j i h g f e d s a z x w q p u k y r v o n t m"; break;
		case "数字制表符":
			oSubTable.value = "1 2 3 4 5 6 7 8 9 0\n─ ┌ ┐ └ ┘ ┬ ├ ┼ ┤ │"; break;
		case "数字记忆编码":
			oSubTable.value = "圆 树 鹅 耳朵 旗 钩子 勺子 镰刀 葫芦 球拍 眼镜 北京 铃儿 东山/登山 冻死/懂事 动物/领悟 动怒/懂了 灵气 泥巴 啤酒 棒球 筷子 婴儿 雨伞/医生 钥匙/仪式/要是 鹦鹉/衣服 杨柳/一路 仪器/一起 泥巴 泥鳅 耳环/耳朵 鳄鱼 鸳鸯 童伞 盒子 二胡 河流 耳机/儿媳 自行车 二舅 山洞 鲨鱼 仙鹤 仙丹 绅士 香烟 山路 山鸡 妇女 香蕉 司令 睡衣 丝袜 四川 石狮 师傅 石榴 司机/死机 书包 死角 五环/武林 劳动者/无疑/我要 孤儿/吾儿 牡丹 武士/青年 木屋 蜗牛 乌鸡 苦瓜 五角 榴莲 儿童 牛儿 庐山/楼上/路上 律师 锣鼓/老虎 顺利 楼梯 萝卜 辣椒/楼主 麒麟 党员/奇异/蜻蜓 企鹅 鸡蛋 骑士 积木 犀牛 猩猩 西瓜 气球 巴黎 军人 父子/白鸽 爬山 巴士 芭蕾舞 八路 妈妈 爸爸 芭蕉 精灵/酒令 球衣 球儿 旧伞 教师 酒壶 酒楼 酒席/香港 酒吧 舅舅\n0 1 2 3 4 5 6 7 8 9 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99"; break;
		case "俄文字母":
			oSubTable.value = "Q W E R T Y U I O P { } q w e r t y u i o p [ ] A S D F G H J K L : \" a s d f g h j k l ; \' Z X C V B N M < > ? z x c v b n m , . /\nА Б В Г Д Е Ё Ж З И Й К а б в г д е ё ж з и й к Л М Н О П Р С Т У Ф Х л м н о п р с т у ф х Ц Ч Ш Щ Ъ Ы Ь Э Ю Я ц ч ш щ ъ ы ь э ю я"; break;
		case "日文平假名":
			oSubTable.value = "~ ! @ # $ % ^ & * ( ) _ + | ` 1 2 3 4 5 6 7 8 9 0 - = \\ Q W E R T Y U I O P { } q w e r t y u i o p [ ] A S D F G H J K L : \" a s d f g h j k l ; \' Z X C V B N M < > ? z x c v b n m , . /\nあ い う え お が ぎ ぐ げ ご @ @ @ @ ぁ ぃ ぅ ぇ ぉ か き く け こ @ ん @ @ ざ じ ず ぜ ぞ だ ぢ づ @ で ど @ さ し す せ そ た ち つ っ て と ゐ ぱ ぴ ぷ ぺ ぽ ば び ぶ べ ぼ @ な に ぬ ね の は ひ ふ へ ほ ゑ ら り る れ ろ や ゆ よ わ @ ま み む め も ゃ ゅ ょ ゎ を"; break;
		case "日文片假名":
			oSubTable.value = "~ ! @ # $ % ^ & * ( ) _ + | ` 1 2 3 4 5 6 7 8 9 0 - = \\ Q W E R T Y U I O P { } q w e r t y u i o p [ ] A S D F G H J K L : \" a s d f g h j k l ; \' Z X C V B N M < > ? z x c v b n m , . /\nア イ ウ @ エ オ ガ @ ギ グ ゲ @ ゴ @ ァ ィ ゥ ヴ ェ ォ カ ヵ キ ク ケ ヶ コ ン ザ ジ ズ ゼ ゾ ダ ヂ ヅ @ デ ド @ サ シ ス セ ソ タ チ ツ ッ テ ト ヰ パ ピ プ ペ ポ バ ビ ブ ベ ボ @ ナ ニ ヌ ネ ノ ハ ヒ フ ヘ ホ ヱ ラ リ ル レ ロ ヤ ユ ヨ ワ @ マ ミ ム メ モ ャ ュ ョ ヮ ヲ"; break;
		case "注音符号":
			oSubTable.value = "1 2 3 4 5 6 7 8 9 0 - q w e r t y u i o p a s d f g h j k l z x c v b n m , . / ;\nㄅ ㄉ ˇ ˋ ㄓ ˊ ˙ ㄚ ㄞ ㄢ ㄦ ㄆ ㄊ ㄍ ㄐ ㄔ ㄗ ㄧ ㄛ ㄟ ㄣ ㄇ ㄋ ㄎ ㄑ ㄕ ㄘ ㄨ ㄜ ㄠ ㄈ ㄌ ㄏ ㄒ ㄖ ㄙ ㄩ ㄝ ㄡ ㄥ ㄤ"; break;
		case "特殊符号":
			oSubTable.value = "q w e r t y u i o p a s d f g h j k l z x c v b n m\n§ № ☆ ★ ○ ● ◎ ◇ ◆ □ ■ △ ▲ ※ → ← ↑ ↓ 〓 ＃ ＆ ＠ ＼ ＾ ＿ ￣"; break;
		case "特殊符号2":
			oSubTable.value = "1 2 3 4 5 6 7 8 9 0 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z , . / \\ ? ; \" : \' { } [ ] ! @ # $ % ^ & * ( ) ~\n㎎ ㎏ ㏕ ㎝ ㎞ ㎡ &#59335; &#505; ㏎ ㏒ ∝ ∞ ζ ♂ ξ ∮ ♀ ≌ Ψ ∫ ⌒ ╰ ℡ № ⊕ 〆 ¤ ^ § ╮ ∽ √ ω × ≈ 〥 ＠ ◎ ⊙ ㊣ Θ ○ ● 〓 ☆ ★ ◆ ◇ ∑ ∏ ※ ＊ ㈱ ︴ 卐 ╬ ∪ ∩ ∈ ㄨ ∵ ∴ ↑ ↓ ↙ ↘ じ 々 &#12350; &#12272; &#12273; &#12274; &#12275; &#12277; &#12276; &#12278; &#12279; &#12280; &#12281; &#12282; &#12283; 〢 〣 の ぁ △"; break;
		case "手机键盘":
			oSubTable.value = "@ a b c d e f g h i j k l m n o p q r s t u v w x y z\n11 21 22 23 31 32 33 41 42 43 51 52 53 61 62 63 71 72 73 74 81 82 83 91 92 93 94"; break;
		case "手机键盘(简)":
			oSubTable.value = "@ a b c d e f g h i j k l m n o p q r s t u v w x y z\n1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 7 8 8 8 9 9 9 9"; break;
                case "手机键盘对称":
			oSubTable.value = "a b c d e f g h i j k l m n o p q r s t u v w x y z\nc b a f e d i h g l k j o n m s r q p v u t z y x w"; break;
		case "手机键盘(形状)":
			oSubTable.value = "a b c d e f g h i j k l m n o p q r s t u v w x y z a e b b b r m n p q s\n7426946 713497 3179 7167 1317946 131746 317869 174639 132879 13287 17349 179 71839 7193 24862 71364 93146 7136489 3197 1328 1793 14863 17293 1937 15358 1379 7426964 3179746 713467 1713497 1713467 17136489 171839 17193 171364 314639 314697"; break;
		case "数字小键盘(形状)":
			oSubTable.value = "a b c d e f g h i j k l m n o p q r s t u v w x y z a e b b b r m n p q s\n1486346 179431 9713 1761 7971346 797146 971263 714693 798213 79821 71943 713 17293 1739 84268 17964 39746 1796423 9731 7982 7139 74269 71839 7391 75952 7913 1486364 9713146 179461 7179431 7179461 71796423 717293 71739 717964 974693 974631"; break;
		case "氨基酸转录":
			oSubTable.value = "u a g c U A G C\na t c g A T C G"; break;
		case "氨基酸":
			oSubTable.value = "a a a a r r r r r r n n d d c c q q e e g g g g h h i i i l l l l l l k k f f p p p p s s s s s s t t t t w y y v v v v m\ngcu gcc gca gcg cgu cgc cga cgg aga agg aau aac gau gac ugu ugc caa cag gaa gag ggu ggc gga ggg cau cac auu auc aua uua uug cuu cuc cua cug aaa aag uuu uuc ccu ccc cca ccg ucu ucc uca ucg agu agc acu acc aca acg ugg uau uac guu guc gua gug aug"; break;
		case "元素周期表":
			oSubTable.value = "h he li be b c n o f ne na mg al si p s cl ar k ca sc ti v cr mn fe co ni cu zn ga ge as se br kr rb sr y zr nb mo tc ru rh pd ag cd in sn sb te i xe cs ba la ce pr nd pm sm eu gd tb dy ho er tm yb lu hf ta w re os ir pt au hg tl pb bi po at rn fr ra ac th pa u np pu am cm bk cf es fm md no lr rf db sg bh hs mt ds rg cn\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112"; break;
	}
}

/////////////////////////////////////////////////////////////
// 栅栏密码
function enRailFence()
{
	removeSpace();
	var strIn = oInput.value;
	var strOut = "";
	var width = clamp(oRailFenceWidth.value, 2, 200);
	var dummy = (width - strIn.length % width) % width;
	strIn += numChar(dummy, "@");
	var height = strIn.length / width;

	for (i = 0; i < width; i++)
	{
		for (var j = 0; j < height; j++)
		{
			strOut += strIn.charAt(j*width+i);
		}
	}
	oInput.value = strOut;
}

function deRailFence()
{
	removeSpace();
	var strIn = oInput.value;
	var strOut = "";
	var height = clamp(oRailFenceWidth.value, 2, 200);
	var dummy = (height - strIn.length % height) % height;
	strIn += numChar(dummy, "@");
	var width = strIn.length / height;

	for (i = 0; i < width; i++)
	{
		for (var j = 0; j < height; j++)
		{
			strOut += strIn.charAt(j*width+i);
		}
	}
	oInput.value = strOut;
}

function enumEnRailFence()
{
	var aStrIn = oInput.value.split("\r\n");
	oInput.value = aStrIn[0];
	removeSpace();
	var s = oInput.value;
	var strOut = s + "\r\n\r\n";
	var w = clamp(oRailFenceWidth.value, 2, 200);
	var bMatch = oRailFenceMatch.checked;

	for (var width = w; width < w + 15; width++)
	{
		if (width > s.length / 2)
			break;
		if (bMatch && s.length % width != 0)
			continue;
		var dummy = (width - s.length % width) % width;
		var strIn = s + numChar(dummy, "@");
		var height = strIn.length / width;
		strOut += width + "栏：\r\n";

		for (i = 0; i < width; i++)
		{
			for (var j = 0; j < height; j++)
			{
				strOut += strIn.charAt(j*width+i);
			}
		}
		strOut += "\r\n\r\n";
	}
	oInput.value = strOut;
}

function enumDeRailFence()
{
	var aStrIn = oInput.value.split("\r\n");
	oInput.value = aStrIn[0];
	removeSpace();
	var s = oInput.value;
	var strOut = s + "\r\n\r\n";
	var h = clamp(oRailFenceWidth.value, 2, 200);
	var bMatch = oRailFenceMatch.checked;

	for (var height = h; height < h + 15; height++)
	{
		if (height > s.length / 2)
			break;
		if (bMatch && s.length % height != 0)
			continue;
		var dummy = (height - s.length % height) % height;
		var strIn = s + numChar(dummy, "@");
		var width = strIn.length / height;
		strOut += height + "栏：\r\n";

		for (i = 0; i < width; i++)
		{
			for (var j = 0; j < height; j++)
			{
				strOut += strIn.charAt(j*width+i);
			}
		}
		strOut += "\r\n\r\n";
	}
	oInput.value = strOut;
}

/////////////////////////////////////////////////////////////
// 凯撒密码
function Caesar(strIn, offset)
{
	var strOut = "";
	for (var i = 0; i < strIn.length; i++)
	{
		var c = strIn.charCodeAt(i);
		strOut += charOffset(c, offset);
	}
	return strOut;
}

function enCaesar()
{
	var offset = clamp(oCaesarOffset.value, -25, 25);
	oInput.value = Caesar(oInput.value, offset);
}

function deCaesar()
{
	var offset = -clamp(oCaesarOffset.value, -25, 25);
	oInput.value = Caesar(oInput.value, offset);
}

// ----------------------------------------------------------
// 凯撒密码 - 列出所有组合(只限1行明文)
function enumCaesar()
{
	var aStrIn = oInput.value.split("\r\n");
	var strOut = "";
	for (var i = 0; i < 26; i++)
	{
		strOut += Caesar(aStrIn[0], i) + "\r\n";
	}
	oInput.value = strOut;
}

// ----------------------------------------------------------
// 凯撒移位(中文版)
function enCaesarUni()
{
	var offset = clamp(oCaesarUniOffset.value, -1000, 1000);
	var strIn = oInput.value;
	var strOut = "", nCode;
	for (var i = 0; i < strIn.length; i++)
	{
		nCode =  strIn.charCodeAt(i);
		if (nCode == 13) // \r
			strOut += "\r"; // do nothing
		else if (nCode == 10) // \n
			strOut += "\n"
		else if (nCode == 32) // space
			strOut += " ";
		else
			strOut += String.fromCharCode(strIn.charCodeAt(i) + offset);
	}
	oInput.value = strOut;
}

function deCaesarUni()
{
	var offset = -parseInt(oCaesarUniOffset.value);
	oCaesarUniOffset.value = offset;
	enCaesarUni();
	oCaesarUniOffset.value = -offset;
}

// 凯撒移位 - 列出所有组合(只限1行明文)
function Caesar2(strIn, offset)
{
	var strOut = "";
	for (var i = 0; i < strIn.length; i++)
	{
		var c = strIn.charCodeAt(i);
		var k = c + offset;
		if ((k<32) || (k>126)) {
			strOut = '';
			break;
		}
		strOut += String.fromCharCode(k);
	}
	return strOut;
}

function enumCaesarUni()
{
	var aStrIn = oInput.value.split("\r\n");
	StrIn = aStrIn[0];
	var min = 127;
	for (var i = 0; i < StrIn.length; i++){
		var c = StrIn.charCodeAt(i);
		if (c < min){
			min = c
		}
	}
	var strOut = StrIn + "\r\n";
	for (var i = 32; i < 127; i++)
	{
		var k = - min + i;
		var str = Caesar2(StrIn, k);
		if ((str != '') && (str != StrIn))
			strOut +=  str + "\r\n";
	}
	oInput.value = strOut;
}
/////////////////////////////////////////////////////////////
// 维吉尼亚密码
function Vigenere(strIn, offset, key, encode)
{
	key = key.toLowerCase().replace(/[^a-z]/g, "");

	var strOut = "";
	var j = 0, offset2;
	for (var i = 0; i < strIn.length; i++)
	{
		var c = strIn.charCodeAt(i);
		if ((c > 64 && c < 91) || (c > 96 && c < 123)) // 是英文字符
		{
			offset2 = key.charCodeAt(j%key.length) - 97 + offset;
			j++;
			if (!encode)
				offset2 = -offset2;
			strOut += charOffset(c, offset2);
		}
		else
			strOut += strIn.charAt(i);
	}
	return strOut;
}

function enVigenere()
{
	var offset = parseInt(oVigenereOffset.value);
	var key = oVigenereKey.value;
	oInput.value = Vigenere(oInput.value, offset, key, true);
}

function deVigenere()
{
	var offset = parseInt(oVigenereOffset.value);
	var key = oVigenereKey.value;
	oInput.value = Vigenere(oInput.value, offset, key, false);
}

/////////////////////////////////////////////////////////////
// 摩斯电码
function enMorse()
{
	var m1 = oMorseDot.value;
	var m2 = oMorseDash.value;
	var m3 = oMorseDiv.value;
	var m4 = oMorseSpace.value;
	var alpha = "abcdefghijklmnopqrstuvwxyz1234567890.,:'?-()@—。，：|？_（）·\r\n";
	var codeStr = "abxbaaaxbabaxbaaxaxaabaxbbaxaaaaxaaxabbbxbabxabaaxbbxbaxbbbxabbaxbbabxabaxaaaxbxaabxaaabxabbxbaabxbabbxbbaaxabbbbxaabbbxaaabbxaaaabxaaaaaxbaaaaxbbaaaxbbbaaxbbbbaxbbbbbxabababxbbaabbxbbbaaaxabbbbaxaabbaaxbaaaabxbabbabxbabbabxabbabaxbaaabxabababxbbaabbxbbbaaaxabbbbaxaabbaaxbaaaabxbabbabxbabbabxabbabaxaaababxbabab";
	codeStr = codeStr.replace(/x/g, m3).replace(/a/g, m1).replace(/b/g, m2);
	var code = codeStr.split(m3);

	var strIn = oInput.value;
	var strOut = "", nCode;
	for (var i = 0; i < strIn.length; i++)
	{
		nCode = alpha.indexOf(strIn.charAt(i).toLowerCase());
		if (nCode != -1)
			strOut += code[nCode] + m3;
		else
			strOut += m4;
	}
	oInput.value = strOut;
}

function deMorse()
{
	var m1 = oMorseDot.value;
	var m2 = oMorseDash.value;
	var m3 = oMorseDiv.value;
	var m4 = oMorseSpace.value;
	var codeStr="";
	var alpha = "abcdefghijklmnopqrstuvwxyz1234567890.,:'?-()@—。，：|？_（）·\r\n";
	var codeStr1 = "abxbaaaxbabaxbaaxaxaabaxbbaxaaaaxaaxabbbxbabxabaaxbbxbaxbbbxabbaxbbabxabaxaaaxbxaabxaaabxabbxbaabxbabbxbbaaxabbbbxaabbbxaaabbxaaaabxaaaaaxbaaaaxbbaaaxbbbaaxbbbbaxbbbbbxabababxbbaabbxbbbaaaxabbbbaxaabbaaxbaaaabxbabbabxbabbabxabbabaxbaaabxabababxbbaabbxbbbaaaxabbbbaxaabbaaxbaaaabxbabbabxbabbabxabbabaxaaababxbabab";
	//一朵wower修改 其他字符无法处理BUG
	var oInput1=oInput.value.replace(/\r\n|\n/g,m3);//换行替换成m3
  for(var i=0;i<oInput1.length;i++){  
	var temp1=oInput1.charAt(i);
	 if(temp1!=m1 && temp1!=m2 && temp1!=m3 && temp1!=m4 && temp1!="\r" && temp1!="\n" && temp1!=m5){
	   oInput1=oInput1.replace(temp1,m3);
	 }
	}
	//一朵wower修改 m1 m2 m3=="a" "b" "x"时出错
	for(var i = 0;i<codeStr1.length;i++){
      var tempC =codeStr1.charAt(i);
      if( tempC == 'a'){
        codeStr = codeStr + m1; //a换成m1
      }else if( tempC == 'b'){
        codeStr = codeStr + m2;
      }else if( tempC == 'x'){
        codeStr = codeStr + m3;
      }
    }
	//codeStr = codeStr.replace(/x/g, m3).replace(/a/g, m1).replace(/b/g, m2);	
	var code = codeStr.split(m3);    
	var rgExp = new RegExp(m4, "g");
	var aStrIn = oInput1.replace(rgExp, m3).split(m3);
	//alert(aStrIn);
	var strOut = "", nCode;
////////////////////////////////////
	for (var i = 0; i < aStrIn.length; i++)
	{
		for (var j = 0; j < code.length; j++)
		{
			if (aStrIn[i] == code[j])
			{
				strOut += alpha.charAt(j);
				break;
			}
		}
		if (j == code.length && i < aStrIn.length-1)
			strOut += " ";	
	}
	oInput.value = strOut;
	/////////////////////////////////////////////////
}

function showMorseTable()
{
	var m1 = oMorseDot.value;
	var m2 = oMorseDash.value;
	var m3 = oMorseDiv.value;
	var m4 = oMorseSpace.value;
	var alpha = "abcdefghijklmnopqrstuvwxyz1234567890.,:'?-()@—。，：|？_（）·\r\n";
	var codeStr = "abxbaaaxbabaxbaaxaxaabaxbbaxaaaaxaaxabbbxbabxabaaxbbxbaxbbbxabbaxbbabxabaxaaaxbxaabxaaabxabbxbaabxbabbxbbaaxabbbbxaabbbxaaabbxaaaabxaaaaaxbaaaaxbbaaaxbbbaaxbbbbaxbbbbbxabababxbbaabbxbbbaaaxabbbbaxaabbaaxbaaaabxbabbabxbabbabxabbabaxbaaabxabababxbbaabbxbbbaaaxabbbbaxaabbaaxbaaaabxbabbabxbabbabxabbabaxaaababxbabab";
	codeStr = codeStr.replace(/x/g, m3).replace(/a/g, m1).replace(/b/g, m2);
	var code = codeStr.split(m3);

	if (alpha.length != code.length)
		alert("编码表长度不等!");
	var str = "", c;
	for (var i = 0; i < code.length; i++)
	{
		c = alpha.charAt(i);
		if (c == "\r") c = "end";
		if (c == "\n") c = "start";
		str += c + " " + code[i] + "\r\n";
	}
	oInput.value = str;
}

/////////////////////////////////////////////////////////////
// 百度字符(GB2312)
function enGB()
{
	var strIn = oInput.value;
	var strOut = "", c;
	var decMode = oCharCodeDec.checked;
	var chineseMode = oCharJustChinese.checked;
	for (var i = 0; i < strIn.length; i++)
	{
		c = vbAsc(strIn.charAt(i));
		if (decMode) // 十进制
		{
			if (c < 256 && chineseMode && c != 32) // c=0x20代表空格
				strOut += strIn.charAt(i);
			else
				strOut += c; // 只加密中文
			if (i < strIn.length-1)
				strOut += " ";
		}
		else // 16进制
		{
			if (c < 256 && chineseMode && c != 32) // c=0x20代表空格
				strOut += strIn.charAt(i);
			else if (c < 256)
			{
				c = c.toString(16).toUpperCase();
				if (c.length < 2)
					c = "0" + c;
				strOut += "%" + c;
			}
			else
			{
				c = c.toString(16).toUpperCase();
				if (c.length < 4)
					c = "0" + c;
				strOut += "%" + c.substr(0,2) + "%" + c.substr(2,2); // 只加密中文
			}
		}
	}
	oInput.value = strOut;
}

function deGBHex() // 解16进制
{
	var strIn = oInput.value;
	var strOut = "", c;
	for (var i = 0; i < strIn.length; i++)
	{
		if (strIn.charAt(i) == "%")
		{
			c = parseInt(strIn.substr(i+1, 2), 16);
			if (c > 127 && c < 256) // 中文
			{
				c = parseInt(strIn.substr(i+4, 2), 16);
				if (c > 0 && c < 256)
				{
					strOut += vbChr(parseInt(strIn.substr(i+1,2)+strIn.substr(i+4,2), 16));
					i += 5;
				}
				else
					strOut += "%";
			}
			else if (c < 128) // 英文
			{
				strOut += vbChr(c);
				i += 2;
			}
			else // 其它
				strOut += "%";
		}
		else
			strOut += strIn.charAt(i);
	}
	oInput.value = strOut;
}

function deGB()
{
	if (!oCharCodeDec.checked)
		deGBHex(); // 解16进制
	else // 解十进制
	{
		var aStrIn = oInput.value.split(" ");
		var strOut = "";
		for (var i = 0; i < aStrIn.length; i++)
		{
			if (aStrIn[i].length > 1)
				strOut += vbChr(parseInt(aStrIn[i]));
			else
				strOut += aStrIn[i];
		}
		oInput.value = strOut;
	}
}

/////////////////////////////////////////////////////////////
// Google字符(URI)
// URI(Uniform Resource Identifier/通用资源标识符)
function enURI()
{
	oInput.value = encodeURI(oInput.value);
}

function deURI()
{
	oInput.value = decodeURI(oInput.value);
}

/////////////////////////////////////////////////////////////
// 网页编码(Unicode)
function enUnicode()
{
	var decMode = oCharCodeDec.checked;
	var chineseMode = oCharJustChinese.checked;

	var strIn = oInput.value;
	var strOut = "", c;

	for (var i = 0; i < strIn.length; i++)
	{
		c = strIn.charCodeAt(i);
		if (c < 256 && chineseMode) // 只加密中文
			strOut += strIn.charAt(i);
		else
		{
			if (decMode) // 十进制
				strOut += "&#" + c + ";";
			else
				strOut += "&#x" + c.toString(16).toUpperCase() + ";"; // 16进制
		}
	}
	oInput.value = strOut;
}

function deUnicode()
{
	oInput.innerHTML = oInput.value.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/&#10;/g, ">");
	oInput.value = oInput.value.replace(/>/g, "\r\n");
}

/////////////////////////////////////////////////////////////
// 百度/Google/网页字符
function enCharCode()
{
　　var ocrd = document.all.oCharCodeRadio;
	if (ocrd[0].checked)
		enGB();
	else if (ocrd[1].checked)
		enURI();
	else // radio[2]
		enUnicode();
}

function deCharCode()
{
	var ocrd = document.all.oCharCodeRadio;
	if (ocrd[0].checked)
		deGB();
	else if (ocrd[1].checked)
		deURI();
	else // radio[2]
		deUnicode();
}

/////////////////////////////////////////////////////////////
// 置换密码
function enTransposition()
{
//	removeSpace();
	var perm = oTranPerm.value.split(" ");
	var strIn = oInput.value;
	var strOut = "", j;

	var dummy = (perm.length - (strIn.length % perm.length)) % perm.length;
	strIn += numChar(dummy, "@");

	for (i = 0; i < strIn.length; i++)
	{
		j = perm[i % perm.length] - 1 + perm.length * Math.floor(i/perm.length);
		strOut += strIn.charAt(j);
	}
	oInput.value = strOut;
}

function deTransposition()
{
	var perm = oTranPerm.value.split(" ");
	var strIn = oInput.value;
	var strOut = "", j;

	var dummy = (perm.length - (strIn.length % perm.length)) % perm.length;
	strIn += numChar(dummy, "@");

	var invperm = new Array();
	for (var i = 0; i < perm.length; i++)
	{
		invperm[perm[i]-1] = i + 1;
	}

	for (i = 0; i < strIn.length; i++)
	{
		j = invperm[i % invperm.length] - 1 + invperm.length * Math.floor(i/invperm.length);
		strOut += strIn.charAt(j);
	}
	oInput.value = strOut;
}

/////////////////////////////////////////////////////////////
// MD5
function enMD5()
{
	oMD5Value.value = md5(oInput.value);
}

/////////////////////////////////////////////////////////////
// functions used for MD5
var hexcase = 1;
var b64pad = "";
var chrsz = 8;
var mode = 32;

function preprocess(form)
{
	var str = "";
	str += form.verifycode.value;
	str = str.toUpperCase();
	form.p.value = md5(md5_3(form.p.value)+str);
	return true;
}

function md5_3(s)
{
	var tmp = new Array;
	tmp = core_md5(str2binl(s), s.length * chrsz);
	tmp = core_md5(tmp, 16 * chrsz);
	tmp = core_md5(tmp, 16 * chrsz);
	return binl2hex(tmp);
}

function md5(s)
{
	return hex_md5(s);
}
function hex_md5(s)
{
	return binl2hex(core_md5(str2binl(s), s.length * chrsz));
}

function b64_md5(s)
{
	return binl2b64(core_md5(str2binl(s), s.length * chrsz));
}

function str_md5(s)
{
	return binl2str(core_md5(str2binl(s), s.length * chrsz));
}

function hex_hmac_md5(key, data)
{
	return binl2hex(core_hmac_md5(key, data));
}

function b64_hmac_md5(key, data)
{
	return binl2b64(core_hmac_md5(key, data));
}

function str_hmac_md5(key, data)
{
	return binl2str(core_hmac_md5(key, data));
}

function md5_vm_test()
{
	return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
}

function core_md5(x, len)
{
	x[len >> 5] |= 0x80 << ((len) % 32);
	x[(((len + 64) >>> 9) << 4) + 14] = len;

	var a =  1732584193;
	var b = -271733879;
	var c = -1732584194;
	var d =  271733878;

	for (var i = 0; i < x.length; i += 16)
	{
		var olda = a;
		var oldb = b;
		var oldc = c;
		var oldd = d;

		a = md5_ff(a, b, c, d, x[i + 0],  7,  -680876936);
		d = md5_ff(d, a, b, c, x[i + 1],  12,  -389564586);
		c = md5_ff(c, d, a, b, x[i + 2],  17, 606105819);
		b = md5_ff(b, c, d, a, x[i + 3],  22,  -1044525330);
		a = md5_ff(a, b, c, d, x[i + 4],  7,  -176418897);
		d = md5_ff(d, a, b, c, x[i + 5],  12, 1200080426);
		c = md5_ff(c, d, a, b, x[i + 6],  17,  -1473231341);
		b = md5_ff(b, c, d, a, x[i + 7],  22,  -45705983);
		a = md5_ff(a, b, c, d, x[i + 8],  7, 1770035416);
		d = md5_ff(d, a, b, c, x[i + 9],  12,  -1958414417);
		c = md5_ff(c, d, a, b, x[i + 10], 17,  -42063);
		b = md5_ff(b, c, d, a, x[i + 11], 22,  -1990404162);
		a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);
		d = md5_ff(d, a, b, c, x[i + 13], 12,  -40341101);
		c = md5_ff(c, d, a, b, x[i + 14], 17,  -1502002290);
		b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);

		a = md5_gg(a, b, c, d, x[i + 1],  5,  -165796510);
		d = md5_gg(d, a, b, c, x[i + 6],  9,  -1069501632);
		c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713);
		b = md5_gg(b, c, d, a, x[i + 0],  20,  -373897302);
		a = md5_gg(a, b, c, d, x[i + 5],  5,  -701558691);
		d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083);
		c = md5_gg(c, d, a, b, x[i + 15], 14,  -660478335);
		b = md5_gg(b, c, d, a, x[i + 4],  20,  -405537848);
		a = md5_gg(a, b, c, d, x[i + 9],  5, 568446438);
		d = md5_gg(d, a, b, c, x[i + 14], 9,  -1019803690);
		c = md5_gg(c, d, a, b, x[i + 3],  14,  -187363961);
		b = md5_gg(b, c, d, a, x[i + 8],  20, 1163531501);
		a = md5_gg(a, b, c, d, x[i + 13], 5,  -1444681467);
		d = md5_gg(d, a, b, c, x[i + 2],  9,  -51403784);
		c = md5_gg(c, d, a, b, x[i + 7],  14, 1735328473);
		b = md5_gg(b, c, d, a, x[i + 12], 20,  -1926607734);

		a = md5_hh(a, b, c, d, x[i + 5],  4,  -378558);
		d = md5_hh(d, a, b, c, x[i + 8],  11,  -2022574463);
		c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);
		b = md5_hh(b, c, d, a, x[i + 14], 23,  -35309556);
		a = md5_hh(a, b, c, d, x[i + 1],  4,  -1530992060);
		d = md5_hh(d, a, b, c, x[i + 4],  11, 1272893353);
		c = md5_hh(c, d, a, b, x[i + 7],  16,  -155497632);
		b = md5_hh(b, c, d, a, x[i + 10], 23,  -1094730640);
		a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174);
		d = md5_hh(d, a, b, c, x[i + 0],  11,  -358537222);
		c = md5_hh(c, d, a, b, x[i + 3],  16,  -722521979);
		b = md5_hh(b, c, d, a, x[i + 6],  23, 76029189);
		a = md5_hh(a, b, c, d, x[i + 9],  4,  -640364487);
		d = md5_hh(d, a, b, c, x[i + 12], 11,  -421815835);
		c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520);
		b = md5_hh(b, c, d, a, x[i + 2],  23,  -995338651);

		a = md5_ii(a, b, c, d, x[i + 0],  6,  -198630844);
		d = md5_ii(d, a, b, c, x[i + 7],  10, 1126891415);
		c = md5_ii(c, d, a, b, x[i + 14], 15,  -1416354905);
		b = md5_ii(b, c, d, a, x[i + 5],  21,  -57434055);
		a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);
		d = md5_ii(d, a, b, c, x[i + 3],  10,  -1894986606);
		c = md5_ii(c, d, a, b, x[i + 10], 15,  -1051523);
		b = md5_ii(b, c, d, a, x[i + 1],  21,  -2054922799);
		a = md5_ii(a, b, c, d, x[i + 8],  6, 1873313359);
		d = md5_ii(d, a, b, c, x[i + 15], 10,  -30611744);
		c = md5_ii(c, d, a, b, x[i + 6],  15,  -1560198380);
		b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);
		a = md5_ii(a, b, c, d, x[i + 4],  6,  -145523070);
		d = md5_ii(d, a, b, c, x[i + 11], 10,  -1120210379);
		c = md5_ii(c, d, a, b, x[i + 2],  15, 718787259);
		b = md5_ii(b, c, d, a, x[i + 9],  21,  -343485551);

		a = safe_add(a, olda);
		b = safe_add(b, oldb);
		c = safe_add(c, oldc);
		d = safe_add(d, oldd);
	}
	if (mode == 16)
	{
		return Array(b, c);
	}
	else
	{
		return Array(a, b, c, d);
	}
}

function md5_cmn(q, a, b, x, s, t)
{
	return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);
}
function md5_ff(a, b, c, d, x, s, t)
{
	return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function md5_gg(a, b, c, d, x, s, t)
{
	return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function md5_hh(a, b, c, d, x, s, t)
{
	return md5_cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5_ii(a, b, c, d, x, s, t)
{
	return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
}

function core_hmac_md5(key, data)
{
	var bkey = str2binl(key);
	if (bkey.length > 16)
	bkey = core_md5(bkey, key.length * chrsz);

	var ipad = Array(16), opad = Array(16);
	for (var i = 0; i < 16; i++)
	{
		ipad[i] = bkey[i] ^ 0x36363636;
		opad[i] = bkey[i] ^ 0x5C5C5C5C;
	}

	var hash = core_md5(ipad.concat(str2binl(data)), 512+data.length * chrsz);
	return core_md5(opad.concat(hash), 512+128);
}

function safe_add(x, y)
{
	var lsw = (x & 0xFFFF) + (y & 0xFFFF);
	var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
	return (msw << 16) | (lsw & 0xFFFF);
}

function bit_rol(num, cnt)
{
	return (num << cnt) | (num  >>> (32-cnt));
}

function str2binl(str)
{
	var bin = Array();
	var mask = (1 << chrsz) - 1;
	for (var i = 0; i < str.length * chrsz; i += chrsz)
		bin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) << (i % 32);
	return bin;
}

function binl2str(bin)
{
	var str = "";
	var mask = (1 << chrsz) - 1;
	for (var i = 0; i < bin.length * 32; i += chrsz)
	str += String.fromCharCode((bin[i >> 5] >>> (i % 32)) & mask);
	return str;
}

function binl2hex(binarray)
{
	var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
	var str = "";

	for (var i = 0; i < binarray.length * 4; i++)
	{
		str += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8+4)) & 0xF) +
		hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF);
	}
	return str;
}

function binl2b64(binarray)
{
	var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
	var str = "";
	for (var i = 0; i < binarray.length * 4; i += 3)
	{
		var triplet = (((binarray[i >> 2] >> 8 * (i % 4)) & 0xFF) << 16) | ((
		(binarray[i + 1 >> 2] >> 8 * ((i + 1) % 4)) & 0xFF) << 8) | ((binarray[i
		+ 2 >> 2] >> 8 * ((i + 2) % 4)) & 0xFF);
		for (var j = 0; j < 4; j++)
		{
			if (i * 8+j * 6 > binarray.length * 32)
				str += b64pad;
			else
				str += tab.charAt((triplet >> 6 * (3-j)) & 0x3F);
		}
	}
	return str;
}

/////////////////////////////////////////////////////////////
// tools
function clean()
{
	oInput.value = "";
}

function line2Space() // 横/竖行切换
{
	if (oInput.value.indexOf("\n") == -1)
		oInput.value = oInput.value.replace(/\s/g, "\r\n");
	else
		oInput.value = oInput.value.replace(/\r\n/g, " ");
}

function removeSpace()
{
	oInput.value = oInput.value.replace(/\s/g, "");
}

function addSpace(n)
{
	n = parseInt(n);
	if (n > 0)
	{
		var strIn = oInput.value;
		var strOut = "";

		for (var i = 0; i < strIn.length; i+=n)
		{
			strOut += strIn.substr(i, n);
			if (i < strIn.length - n)
				strOut += " ";
		}
		oInput.value = strOut;
	}
	else
		oInput.value = oInput.value.replace(/(^\s+)|(\s+$)/g, "").replace(/\s+/g, " ");
}

function allUpperCase()
{
	oInput.value = oInput.value.toUpperCase();
}

function allLowerCase()
{
	oInput.value = oInput.value.toLowerCase();
}

function allReverse()
{
	oInput.value = Reverse(oInput.value);
}

function wordReverse()
{
	var strIn = oInput.value;
	var strOut = "";
	var aStrIn = strIn.split(" ");
	for (var i = 0; i < aStrIn.length; i++)
	{
		strOut += Reverse(aStrIn[i]);
		if (i < aStrIn.length - 1)
			strOut += " ";
	}
	oInput.value = strOut;
}

function hideAllDiv()
{
	divCaesar.style.display = "none";
	divCaesarUni.style.display = "none";
	divVigenere.style.display = "none";
	divMorse.style.display = "none";
	divSubstitution.style.display = "none";
	divCharCode.style.display = "none";
	divMD5.style.display = "none";
	divRailFence.style.display = "none";
	divTransposition.style.display = "none";
}

function freqAnalysis()
{
	var aFreq = new Array(26);
	for (var i = 0; i < 26; i++)
		aFreq[i] = 0;

	var strIn = oInput.value.toLowerCase();
	var strOut = "字符\t频率\t数量\r\n";
	var num = 0;
	for (i = 0; i < strIn.length; i++)
	{
		var idx = ALPHABET.indexOf(strIn.charAt(i));
		if (idx != -1)
		{
			aFreq[idx]++;
			num++;
		}
	}
	for (i = 0; i <26; i++)
	{
		strOut += ALPHABET.charAt(i)  + "\t" +  (Math.floor(aFreq[i]*100/num)/100) + "%\t" + aFreq[i] + "\n";
	}
	strOut = "共出现" + num + "个英文字符\r\n\r\n" + strOut;
	alert(strOut);
}

function PinYin()
{
	if (oCharJustChinese.checked && divCharCode.style.display == "block") {dePinYin(); return;}

	var aKey = new Array(0,45217,45219,45232,45241,45244,45253,45271,45279,45294,45306,45485,45500,45504,45510,45534,45546,45550,45554,45560,45731,45752,45761,45762,45773,45780,45785,45790,45795,45797,45808,45811,45821,45996,46005,46011,46021,46036,46052,46057,46069,46247,46248,46255,46261,46266,46273,46275,46287,46293,46294,46298,46301,46309,46312,46318,46324,46498,46513,46518,46530,46533,46540,46559,46575,46584,46753,46762,46763,46773,46780,46795,46801,46805,46814,46826,46839,46840,47010,47018,47035,47046,47058,47073,47088,47089,47090,47297,47299,47305,47316,47325,47335,47352,47353,47355,47524,47539,47548,47566,47572,47575,47586,47589,47605,47608,47614,47777,47784,47803,47806,47815,47833,47835,47839,47844,47853,47860,48040,48049,48054,48068,48082,48103,48109,48119,48334,48351,48553,48566,48594,48621,48803,48828,48830,48847,48872,48879,48889,49062,49066,49071,49077,49084,49088,49103,49107,49109,49113,49117,49124,49129,49133,49135,49143,49316,49320,49324,49331,49334,49349,49356,49365,49367,49378,49381,49577,49578,49592,49603,49616,49621,49633,49647,49658,49829,49835,49855,49869,49875,49877,49884,49896,49905,49911,50082,50088,50100,50101,50117,50120,50128,50142,50151,50159,50161,50167,50173,50174,50353,50356,50371,50378,50383,50386,50387,50392,50393,50395,50396,50397,50408,50415,50417,50419,50426,50427,50595,50599,50603,50606,50607,50608,50610,50614,50615,50622,50628,50634,50642,50647,50654,50663,50665,50679,50858,50862,50866,50868,50873,50882,50891,50906,50942,51107,51129,51137,51152,51157,51168,51181,51183,51191,51366,51377,51385,51387,51391,51396,51399,51401,51411,51413,51414,51424,51427,51437,51439,51442,51444,51446,51449,51453,51619,51622,51626,51629,51630,51631,51640,51642,51658,51666,51677,51689,51705,51878,51925,51935,52130,52132,52136,52138,52141,52145,52149,52153,52169,52177,52180,52193,52196,52207,52210,52218,52389,52398,52416,52429,52440,52441,52445,52460,52468,52473,52476,52648,52661,52665,52676,52678,52684,52687,52698,52705,52707,52724,52734,52929,52939,52942,52951,52980,53177,53190,53216,53236,53416,53437,53447,53462,53469,53478,53497,53669,53675,53689,53705,53738,53755,53932,53947,54000,54178,54196,54197,54212,54233,54439,54459,54469,54481,54484,54491,54495,54498,54512,54516,54517,54518,54522,54698,54704,54721,54736,54746,54756,54772,54949,54992,55003,55017,55205,55207,55208,55214,55221,55227,55229,55240,55255,55262,55266,55274,55276,55280,55282,65536);
	var aItem = new Array(".","a","ai","an","ang","ao","ba","bai","ban","bang","bao","bei","ben","beng","bi","bian","biao","bie","bin","bing","bo","bu","ca","cai","can","cang","cao","ce","ceng","cha","chai","chan","chang","chao","che","chen","cheng","chi","chong","chou","chu","chuai","chuan","chuang","chui","chun","chuo","ci","cong","cou","cu","cuan","cui","cun","cuo","da","dai","dan","dang","dao","de","deng","di","dian","diao","die","ding","diu","dong","dou","du","duan","dui","dun","duo","e","en","er","fa","fan","fang","fei","fen","feng","fo","fou","fu","ga","gai","gan","gang","gao","ge","gei","gen","geng","gong","gou","gu","gua","guai","guan","guang","gui","gun","guo","ha","hai","han","hang","hao","he","hei","hen","heng","hong","hou","hu","hua","huai","huan","huang","hui","hun","huo","ji","jia","jian","jiang","jiao","jie","jin","jing","jiong","jiu","ju","juan","jue","jun","ka","kai","kan","kang","kao","ke","ken","keng","kong","kou","ku","kua","kuai","kuan","kuang","kui","kun","kuo","la","lai","lan","lang","lao","le","lei","leng","li","lia","lian","liang","liao","lie","lin","ling","liu","long","lou","lu","lv","luan","lue","lun","luo","ma","mai","man","mang","mao","me","mei","men","meng","mi","mian","miao","mie","min","ming","miu","mo","mou","mu","na","nai","nan","nang","nao","ne","nei","nen","neng","ni","nian","niang","niao","nie","nin","ning","niu","nong","nu","nv","nuan","nue","nuo","o","ou","pa","pai","pan","pang","pao","pei","pen","peng","pi","pian","piao","pie","pin","ping","po","pu","qi","qia","qian","qiang","qiao","qie","qin","qing","qiong","qiu","qu","quan","que","qun","ran","rang","rao","re","ren","reng","ri","rong","rou","ru","ruan","rui","run","ruo","sa","sai","san","sang","sao","se","sen","seng","sha","shai","shan","shang","shao","she","shen","sheng","shi","shou","shu","shua","shuai","shuan","shuang","shui","shun","shuo","si","song","sou","su","suan","sui","sun","suo","ta","tai","tan","tang","tao","te","teng","ti","tian","tiao","tie","ting","tong","tou","tu","tuan","tui","tun","tuo","wa","wai","wan","wang","wei","wen","weng","wo","wu","xi","xia","xian","xiang","xiao","xie","xin","xing","xiong","xiu","xu","xuan","xue","xun","ya","yan","yang","yao","ye","yi","yin","ying","yo","yong","you","yu","yuan","yue","yun","za","zai","zan","zang","zao","ze","zei","zen","zeng","zha","zhai","zhan","zhang","zhao","zhe","zhen","zheng","zhi","zhong","zhou","zhu","zhua","zhuai","zhuan","zhuang","zhui","zhun","zhuo","zi","zong","zou","zu","zuan","zui","zun","zuo",".");

	var strIn = oInput.value;
	var strOut = "", c;
	for (var i = 0; i < strIn.length; i++)
	{
		c = vbAsc(strIn.charAt(i));
		if (c < 45217) // c < 256
			strOut += strIn.charAt(i);
		else if (c == 49611)
			strOut += "le";   // 了
		else if (c == 46780)
			strOut += "dou";  // 都
		else if (c == 51890)
			strOut += "shen"; // 什
		else if (c == 55237)
			strOut += "zhe";  // 着
		else
		{
			for (j = 0; j < aKey.length; j++)
			{
				if (aKey[j] > c)
				{
					strOut += aItem[j-1];
					break;
				}
			}
		}
		if (i < strIn.length - 1)
			strOut += " ";
	}
	oInput.value = strOut;
}

function dePinYin()
{
	var aKey = new Array("啊","哎","安","昂","奥","吧","白","半","帮","包","被","本","崩","比","变","表","别","宾","冰","波","不","擦","菜","参","苍","草","侧","层","查","拆","产","厂","超","车","郴","成","吃","充","抽","出","揣","传","窗","吹","春","戳","次","从","凑","粗","蹿","摧","存","错","大","代","但","当","到","的","等","地","电","掉","碟","定","丢","动","都","读","端","对","顿","多","恶","恩","而","发","反","方","非","分","风","佛","否","付","嘎","改","干","刚","高","个","给","根","更","工","够","古","挂","怪","关","光","归","滚","过","哈","还","含","航","好","和","黑","很","横","红","后","湖","花","坏","换","黄","会","混","或","及","家","见","将","叫","接","进","竟","窘","就","句","卷","决","军","卡","开","看","抗","靠","可","肯","坑","空","扣","苦","夸","快","宽","框","亏","困","阔","拉","来","蓝","狼","老","了","类","冷","里","俩","连","两","料","列","林","另","六","龙","楼","路","绿","乱","略","论","落","马","买","满","忙","毛","么","没","们","梦","米","面","秒","灭","民","名","谬","莫","某","目","那","奶","难","囊","脑","呢","内","嫩","能","你","年","娘","鸟","捏","您","宁","牛","弄","奴","女","暖","虐","挪","哦","欧","怕","拍","盘","旁","跑","陪","盆","朋","皮","片","飘","撇","品","平","破","扑","其","恰","前","强","桥","切","亲","青","穷","求","去","全","却","群","然","让","绕","热","人","仍","日","容","柔","如","软","瑞","闰","若","撒","赛","三","桑","扫","色","森","僧","沙","晒","山","上","少","设","甚","生","是","手","书","刷","摔","栓","双","水","顺","说","四","送","搜","速","算","虽","孙","所","他","太","谈","堂","套","特","疼","体","天","条","贴","听","同","头","图","团","推","吞","拖","挖","外","完","网","为","文","翁","我","无","西","下","先","相","小","写","新","形","雄","修","许","选","学","寻","呀","眼","样","要","也","以","因","应","哟","用","有","于","远","越","云","杂","在","咱","脏","早","则","贼","怎","增","扎","摘","站","张","找","这","真","正","只","中","周","住","抓","拽","专","装","追","准","捉","子","总","走","组","钻","最","尊","做");
	var aItem = new Array("a","ai","an","ang","ao","ba","bai","ban","bang","bao","bei","ben","beng","bi","bian","biao","bie","bin","bing","bo","bu","ca","cai","can","cang","cao","ce","ceng","cha","chai","chan","chang","chao","che","chen","cheng","chi","chong","chou","chu","chuai","chuan","chuang","chui","chun","chuo","ci","cong","cou","cu","cuan","cui","cun","cuo","da","dai","dan","dang","dao","de","deng","di","dian","diao","die","ding","diu","dong","dou","du","duan","dui","dun","duo","e","en","er","fa","fan","fang","fei","fen","feng","fo","fou","fu","ga","gai","gan","gang","gao","ge","gei","gen","geng","gong","gou","gu","gua","guai","guan","guang","gui","gun","guo","ha","hai","han","hang","hao","he","hei","hen","heng","hong","hou","hu","hua","huai","huan","huang","hui","hun","huo","ji","jia","jian","jiang","jiao","jie","jin","jing","jiong","jiu","ju","juan","jue","jun","ka","kai","kan","kang","kao","ke","ken","keng","kong","kou","ku","kua","kuai","kuan","kuang","kui","kun","kuo","la","lai","lan","lang","lao","le","lei","leng","li","lia","lian","liang","liao","lie","lin","ling","liu","long","lou","lu","lv","luan","lue","lun","luo","ma","mai","man","mang","mao","me","mei","men","meng","mi","mian","miao","mie","min","ming","miu","mo","mou","mu","na","nai","nan","nang","nao","ne","nei","nen","neng","ni","nian","niang","niao","nie","nin","ning","niu","nong","nu","nv","nuan","nue","nuo","o","ou","pa","pai","pan","pang","pao","pei","pen","peng","pi","pian","piao","pie","pin","ping","po","pu","qi","qia","qian","qiang","qiao","qie","qin","qing","qiong","qiu","qu","quan","que","qun","ran","rang","rao","re","ren","reng","ri","rong","rou","ru","ruan","rui","run","ruo","sa","sai","san","sang","sao","se","sen","seng","sha","shai","shan","shang","shao","she","shen","sheng","shi","shou","shu","shua","shuai","shuan","shuang","shui","shun","shuo","si","song","sou","su","suan","sui","sun","suo","ta","tai","tan","tang","tao","te","teng","ti","tian","tiao","tie","ting","tong","tou","tu","tuan","tui","tun","tuo","wa","wai","wan","wang","wei","wen","weng","wo","wu","xi","xia","xian","xiang","xiao","xie","xin","xing","xiong","xiu","xu","xuan","xue","xun","ya","yan","yang","yao","ye","yi","yin","ying","yo","yong","you","yu","yuan","yue","yun","za","zai","zan","zang","zao","ze","zei","zen","zeng","zha","zhai","zhan","zhang","zhao","zhe","zhen","zheng","zhi","zhong","zhou","zhu","zhua","zhuai","zhuan","zhuang","zhui","zhun","zhuo","zi","zong","zou","zu","zuan","zui","zun","zuo");

	var aStrIn = oInput.value.split(" ");
	var strOut = "", py;
	for (var i = 0; i < aStrIn.length; i++)
	{
		py = aStrIn[i];
		for (j = 0; j < aItem.length; j++)
		{
			if (aItem[j] == py)
			{
				strOut += aKey[j];
				break;
			}
		}
		if (j == aItem.length)
			strOut += " " + aStrIn[i];
	}
	oInput.value = strOut;
}

function textReplace()
{
	var s1 = oReplaceFrom.value.replace(/\\n/g, "\r\n").replace(/\\t/g, "\t").replace(/([.*+?^$|(){}\[\]\\])/g, "\\$1");
	var s2 = oReplaceTo.value.replace(/\\n/g, "\r\n").replace(/\\t/g, "\t");
	var rgExp = new RegExp(s1, "g");
	oInput.value = oInput.value.replace(rgExp, s2);
}

function convertNum()
{
	var n1 = parseInt(oCNOptions1.options[oCNOptions1.selectedIndex].value);
	var n2 = parseInt(oCNOptions2.options[oCNOptions2.selectedIndex].value);
	var num;
	oInput.value = oInput.value.replace(/(^\s+)|(\s+$)/g, "").replace(/\s+/g, " ");
	var aStrIn = oInput.value.split(" ");
	var strOut = "";

	for (var i = 0; i < aStrIn.length; i++)
	{
		num = parseInt(aStrIn[i], n1);
		strOut += num.toString(n2);
		if (i < aStrIn.length - 1)
			strOut += " ";
	}
	oInput.innerText = strOut;
}

function test()
{
}
</script>

<script language="VBScript">
Function vbChr(c)
	vbChr = chr(c)
End Function

Function vbAsc(c)
	vbAsc = Asc(c)
	If vbAsc < 0 Then vbAsc = vbAsc + 65536
End Function

Function str2bin(varstr)
	str2bin=""
	msgbox(Len(varstr))
	For i=1 To Len(varstr)
		varchar=mid(varstr,i,1)
		varasc = Asc(varchar)
		If varasc<0 Then
			varasc = varasc + 65535
		End If
		If varasc>255 Then
			varlow = Left(Hex(Asc(varchar)),2)
			varhigh = right(Hex(Asc(varchar)),2)
			str2bin = str2bin & chrB("&H" & varlow) & chrB("&H" & varhigh)
		Else
			str2bin = str2bin & chrB(Asc(varchar))
		End If
	Next
End Function

Function calculator()
	oReplaceTo.value = eval(oReplaceFrom.value)
End Function
</script>

<meta content="MSHTML 6.00.6000.16705" name="GENERATOR">
</head>

<body>
<p style="font-weight: bold;"><input onClick="hideAllDiv();divRailFence.style.display='block'" name="oCType" type="radio">栅栏密码 <input onClick="hideAllDiv();divCaesar.style.display='block'" name="oCType" type="radio">凯撒密码 <input onClick="hideAllDiv();divCaesarUni.style.display='block'" name="oCType" type="radio">凯撒移位(中文版) <input onClick="hideAllDiv();divVigenere.style.display='block'" name="oCType" type="radio">维吉尼亚密码 <input onClick="hideAllDiv();divMorse.style.display='block'" name="oCType" type="radio">摩斯电码 <br><input onClick="hideAllDiv();divCharCode.style.display='block'" name="oCType" type="radio">百度/Google/网页字符 <input onClick="hideAllDiv();divMD5.style.display='block'" name="oCType" type="radio">MD5 
<input onClick="hideAllDiv();divTransposition.style.display='block'" name="oCType" type="radio">置换密码 <input onClick="hideAllDiv();divSubstitution.style.display='block'" checked="checked" name="oCType" type="radio">替代密码 </p>
<p><!--input type="button" value="test" onclick="test()"--><input title="清除全部" onClick="clean()" value="清空" type="button"> 
<input title="汉字转为拼音" onClick="PinYin()" value="拼音" type="button"> <input title="频率分析" onClick="freqAnalysis()" value="频率" type="button"> <input title="去空格" onClick="removeSpace()" value="去空格" type="button"> 每隔<input id="oAddSpaceNum" style="width: 30px;" value="2">个字符<input title="添加空格" onClick="addSpace(oAddSpaceNum.value)" value="加空格" type="button"> 
<input title="横/竖行转换(空格&lt;-&gt;换行)" onClick="line2Space()" value="横/竖" type="button"> <input title="全部大写" onClick="allUpperCase()" value="大写" type="button"> <input title="全部小写" onClick="allLowerCase()" value="小写" type="button"> <input title="全部倒序" onClick="allReverse()" value="倒序" type="button"> <input title="单词倒序" onClick="wordReverse()" value="词倒序" type="button"> <br><input id="oReplaceFrom" style="width: 160px;"> <input id="oReplaceTo" style="width: 160px;"> 
<input title="替换文本" onClick="textReplace()" value="替换" type="button"> <input title="计算器" onClick="calculator()" value="计算" type="button">&nbsp; <select name="oCNOptions1"> <option value="2">二进制</option> <option value="8">八进制</option> 
  <option value="10" selected="selected">十进制</option> <option value="16">十六进制</option></select> 
&gt; <select name="oCNOptions2"> <option value="2">二进制</option> <option value="8">八进制</option> <option value="10">十进制</option> <option value="16" selected="selected">十六进制</option></select> <input title="进制转换" onClick="convertNum()" value="转换" type="button"> </p><!-- 栅栏密码 -->
<div id="divRailFence" style="display: none;">
<h3>栅栏密码</h3>
<p>在下面的文本框输入明文或密文，点加密或解密，文本框中即可出现所得结果</p><input onClick="enRailFence()" value="加密" type="button"> 
<input onClick="deRailFence()" value="解密" type="button"> <input onClick="enumEnRailFence()" value="列举加密" type="button"> <input onClick="enumDeRailFence()" value="列举解密" type="button"> 栏数：<input id="oRailFenceWidth" style="width: 100px;" value="2"> <input id="oRailFenceMatch" checked="checked" type="checkbox">只列举完整匹配的 <br></div><!-- 凯撒密码 -->
<div id="divCaesar" style="display: none;">
<h3>凯撒密码</h3>
<p>在下面的文本框输入明文或密文，点加密或解密，文本框中即可出现所得结果</p><input onClick="enCaesar()" value="加密" type="button"> 
<input onClick="deCaesar()" value="解密" type="button"> <input onClick="enumCaesar()" value="列出所有组合" type="button"> 位移数(-25~25)：<input id="oCaesarOffset" style="width: 100px;" value="1"><br></div><!-- 凯撒移位(中文版) -->
<div id="divCaesarUni" style="display: none;">
<h3>凯撒移位(中文版)</h3>
<p>在下面的文本框输入明文或密文，点加密或解密，文本框中即可出现所得结果</p><input onClick="enCaesarUni()" value="加密" type="button"> 
<input onClick="deCaesarUni()" value="解密" type="button"> <input onClick="enumCaesarUni()" value="列出所有组合" type="button"> 位移数(-50~1000)：<input id="oCaesarUniOffset" style="width: 100px;" value="1"> </div><!-- 维吉尼亚密码 -->
<div id="divVigenere" style="display: none;">
<h3>维吉尼亚密码</h3>
<p>在下面的文本框输入明文或密文，点加密或解密，文本框中即可出现所得结果</p><input onClick="enVigenere()" value="加密" type="button"> 
<input onClick="deVigenere()" value="解密" type="button"> 位移数(-25~25)：<input id="oVigenereOffset" style="width: 100px;" value="0"><br>密钥： <textarea id="oVigenereKey" style="height: 50px;">bcdefghijklmnopqrstuvwxyza</textarea><br></div><!-- 摩斯电码 -->
<div id="divMorse" style="display: none;">
<h3>摩斯电码</h3>
<p>在下面的文本框输入明文或密文，点加密或解密，文本框中即可出现所得结果</p><input onClick="enMorse()" value="加密" type="button"> 
<input onClick="deMorse()" value="解密" type="button"> <input onClick="showMorseTable()" value="显示码表" type="button"><br>点：<input id="oMorseDot" style="width: 30px;" value="*"> 划：<input id="oMorseDash" style="width: 30px;" value="-"> 
字母间隔：<input id="oMorseDiv" style="width: 30px;" value="/"> 单词间隔：<input id="oMorseSpace" style="width: 30px;" value=" "><br></div><!-- 置换密码 -->
<div id="divTransposition" style="display: none;">
<h3>置换密码</h3>
<p>在下面的文本框输入明文或密文，点加密或解密，文本框中即可出现所得结果</p><input onClick="enTransposition()" value="加密" type="button"> 
<input onClick="deTransposition()" value="解密" type="button"> 排列：<input id="oTranPerm" style="width: 250px;" value="2 1 6 5 3 4"> </div><!-- 替代密码 -->
<div id="divSubstitution" style="display: block;">
<h3>替代密码</h3>
<p>在下面的文本框输入明文或密文，点加密或解密，文本框中即可出现所得结果</p><input onClick="enSubstitution()" value="加密" type="button"> 
<input onClick="outSubstitution()" value="解密" type="button"> <input onClick="showSubstitutionItem()" value="解密并注释" type="button"> 类型：<select onChange="changeSubstitutionTable()" name="oSubOptions" id="oSubOptions"> <option selected="selected">字母表代码</option> <option>字母表数字</option> <option>培根大小写</option> <option>培根ab</option> <option>Atbash</option> 
  <option>QWE</option> <option>5*5矩阵</option> <option>三进制</option> 
  <option>V字</option> <option>三分密码</option> <option>费纳姆密码</option>
  <option>随机乱序字母</option> <option>棋盘密码</option> <option>键盘密码1</option> 
  <option>键盘密码2</option> <option>键盘移位</option> <option>键盘对称</option> <option>数字制表符</option> 
  <option>俄文字母</option> <option>日文平假名</option> <option>日文片假名</option> 
  <option>注音符号</option> <option>特殊符号</option> <option>特殊符号2</option> 
  <option>手机键盘</option> <option>手机键盘(简)</option> <option>手机键盘对称</option> <option>手机键盘(形状)</option> 
  <option>数字小键盘(形状)</option> <option>数字记忆编码</option> <option>氨基酸转录</option> <option>氨基酸</option> <option>元素周期表</option></select> <input id="oSubCaseSen" checked="checked" type="checkbox">忽略大小写 <br>代码表： <textarea id="oSubTable" wrap="off" style="height: 85px;">a b c d e f g h i j k l m n o p q r s t u v w x y z
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26</textarea><br></div><!-- 百度/Google/网页字符 -->
<div id="divCharCode" style="display: none;">
<h3 id="oCharCodeTitle">百度字符(GB2312)</h3>
<p>在下面的文本框输入明文或密文，点加密或解密，文本框中即可出现所得结果</p><input onClick="oCharCodeTitle.innerText='百度字符(GB2312)'" checked="checked" name="oCharCodeRadio" type="radio">百度字符(GB2312) <input onClick="oCharCodeTitle.innerText='Google字符(URI)'" name="oCharCodeRadio" type="radio">Google字符(URI) <input onClick="oCharCodeTitle.innerText='网页编码(Unicode)'" name="oCharCodeRadio" type="radio">网页编码(Unicode) <br><input onClick="enCharCode()" value="加密" type="button"> <input onClick="deCharCode()" value="解密" type="button"> <input id="oCharCodeDec" type="checkbox">十进制 <input id="oCharJustChinese" type="checkbox">只加密中文 </div><!-- MD5 -->
<div id="divMD5" style="display: none;">
<h3>MD5</h3>
<p>在下面的文本框输入明文或密文，点加密或解密，文本框中即可出现所得结果</p><input onClick="enMD5()" value="MD5加密" type="button"> 
生成的MD5代码：<input id="oMD5Value" style="width: 320px;"><br></div><!-- $$$$$$$$$$$$$$$$$$$$$$$ TOOLS $$$$$$$$$$$$$$$$$$$$$$$ --><!-- ddd -->
<div id="div33" style="display: none;">
<h3>密码</h3>
<p>在下面的文本框输入明文或密文，点加密或解密，文本框中即可出现所得结果</p><input onClick="encode()" value="加密" type="button"> 
<input onClick="decode()" value="解密" type="button"><br><input id="oParam3" style="width: 100px;"> 
<textarea id="oParam3" style="height: 50px;"></textarea><br></div><!-- 密文框 -->密文框：<br><textarea id="oInput" style="height: 300px;"></textarea><br>
<p align='center'>美化征集中...</p>
</body></html>